#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include "disjointSet.hpp"

using namespace std;

void test1()
{
	disjointSet<int> disjSet(10);
	disjSet.Union(3, 5);
	disjSet.Union(3, 7);

	disjSet.Union(4, 9);
	cout << disjSet.isSameSet(3, 5) << endl;
	cout << disjSet.isSameSet(3, 7) << endl;
	cout << disjSet.isSameSet(5, 7) << endl;
	cout << disjSet.isSameSet(4, 9) << endl;

	cout << disjSet.isSameSet(3, 9) << endl;
	cout << disjSet.size() << endl;

}

void test2()
{
	string strArr[5] = { "aa", "bb", "cc", "dd", "ee" };
	disjointSet<string> disJSet(strArr, 5);
	disJSet.Union("aa", "bb");
	disJSet.Union("aa", "cc");
	disJSet.Union("dd", "ee");

	cout << disJSet.isSameSet("aa", "bb") << endl;
	cout << disJSet.isSameSet("aa", "cc") << endl;
	cout << disJSet.isSameSet("bb", "cc") << endl;
	cout << disJSet.isSameSet("dd", "ee") << endl;

	cout << disJSet.isSameSet("aa", "dd") << endl;
	cout << disJSet.size() << endl;
}

int main()
{
	//test1();
	test2();
	return 0;
}